/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author USER
 */
@Entity
@Table(name = "filmtipleri")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Filmtipleri.findAll", query = "SELECT f FROM Filmtipleri f"),
    @NamedQuery(name = "Filmtipleri.findByIdFilmTipleri", query = "SELECT f FROM Filmtipleri f WHERE f.idFilmTipleri = :idFilmTipleri"),
    @NamedQuery(name = "Filmtipleri.findByTipIsmi", query = "SELECT f FROM Filmtipleri f WHERE f.tipIsmi = :tipIsmi"),
    @NamedQuery(name = "Filmtipleri.findByGenelIzleyici", query = "SELECT f FROM Filmtipleri f WHERE f.genelIzleyici = :genelIzleyici")})
public class Filmtipleri implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idFilmTipleri")
    private Integer idFilmTipleri;
    @Column(name = "tipIsmi")
    private String tipIsmi;
    @Column(name = "genelIzleyici")
    private Boolean genelIzleyici;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tipId")
    private Collection<Film> filmCollection;

    public Filmtipleri() {
    }

    public Filmtipleri(Integer idFilmTipleri) {
        this.idFilmTipleri = idFilmTipleri;
    }

    public Integer getIdFilmTipleri() {
        return idFilmTipleri;
    }

    public void setIdFilmTipleri(Integer idFilmTipleri) {
        this.idFilmTipleri = idFilmTipleri;
    }

    public String getTipIsmi() {
        return tipIsmi;
    }

    public void setTipIsmi(String tipIsmi) {
        this.tipIsmi = tipIsmi;
    }

    public Boolean getGenelIzleyici() {
        return genelIzleyici;
    }

    public void setGenelIzleyici(Boolean genelIzleyici) {
        this.genelIzleyici = genelIzleyici;
    }

    @XmlTransient
    public Collection<Film> getFilmCollection() {
        return filmCollection;
    }

    public void setFilmCollection(Collection<Film> filmCollection) {
        this.filmCollection = filmCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idFilmTipleri != null ? idFilmTipleri.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Filmtipleri)) {
            return false;
        }
        Filmtipleri other = (Filmtipleri) object;
        if ((this.idFilmTipleri == null && other.idFilmTipleri != null) || (this.idFilmTipleri != null && !this.idFilmTipleri.equals(other.idFilmTipleri))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Filmtipleri[ idFilmTipleri=" + idFilmTipleri + " ]";
    }
    
}
